﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SIPO.master" AutoEventWireup="false" 
CodeFile="rptRecCorporateAction.aspx.cs" Inherits="SIPO.Web.Reports.Transaction.rptRecCorporateAction" %>

<asp:Content ID="ctnBody" ContentPlaceHolderID="body" runat="server">
    <script src="<%= ResolveUrl("~/scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/scripts/jquery.validate.wrapper.js") %>" type="text/javascript"></script>
    <link href="<%= ResolveUrl("~/styles/jquery.validate.error.css") %>" rel="stylesheet" type="text/css" />
    <script src="<%= ResolveUrl("~/scripts/jquery-ui.min.js") %>" type="text/javascript"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            //default radio button semua
            $("#<%= txtPeriodeAwal.ClientID %>").attr('disabled', 'disabled');
            $("#<%= txtPeriodeAkhir.ClientID %>").attr('disabled', 'disabled');
            $("#<%= txtTahun.ClientID %>").attr('disabled', 'disabled');
            $("#<%= ddlJenisAksiKorporasi.ClientID %>").attr('disabled', 'disabled');
            $("#<%= ddlSektor.ClientID %>").attr('disabled', 'disabled');
            $("#<%= ddlSubSektor.ClientID %>").attr('disabled', 'disabled');
            $("#<%= ddlSubSubSektor.ClientID %>").attr('disabled', 'disabled');
            $("#<%= txtPeriodeAwal.ClientID %>").val('');
            $("#<%= txtPeriodeAkhir.ClientID %>").val('');
            $("#<%= ddlJenisAksiKorporasi.ClientID %>").val('-- pilih aksi korporasi --');
            $("#<%= ddlSektor.ClientID %>").val('-- pilih sektor --');
            $("#<%= ddlSubSektor.ClientID %>").val('-- pilih sub sektor --');
            $("#<%= ddlSubSubSektor.ClientID %>").val('-- pilih sub sub sektor --');

            //format tahun harus angka
            $('#<%= txtTahun.ClientID %>').bind('keyup blur', function () {
                $(this).val($(this).val().replace(/[^0-9]/g, ''))
            });

            // format tanggal dengan datepicker
            $("#<%= txtPeriodeAwal.ClientID  %>").datepicker({ showWeek: true, showButtonPanel: true,
                changeMonth: true, changeYear: true, dateFormat: 'dd/mm/yy',
                numberOfMonths: 1,
                onSelect: function (selected) {
                    $("#<%= txtPeriodeAkhir.ClientID %>").datepicker("option", "minDate", selected)
                }
            });

            $("#<%= txtPeriodeAkhir.ClientID  %>").datepicker({ showWeek: true, showButtonPanel: true,
                changeMonth: true, changeYear: true, dateFormat: 'dd/mm/yy',
                numberOfMonths: 1,
                onSelect: function (selected) {
                    $("#<%= txtPeriodeAwal.ClientID %>").datepicker("option", "maxDate", selected)
                }
            });

            //Tahun tidak boleh huruf dan karakter khusus
            $("#<%= txtTahun.ClientID %>").bind('keyup blur', function () {
                $(this).val($(this).val().replace(/[^0-9]/g, ''))
            });

            //radio button periode awal dan periode akhir
            $("#<%= rbPeriode1.ClientID %>").click(function () {
                $("#<%= txtPeriodeAwal.ClientID %>").removeAttr('disabled');
                $("#<%= txtPeriodeAkhir.ClientID %>").removeAttr('disabled');
                $("#<%= txtTahun.ClientID %>").attr('disabled','disabled');
            });

            $("#<%= rbPeriode2.ClientID %>").click(function () {
                $("#<%= txtPeriodeAwal.ClientID %>").attr('disabled', 'disabled');
                $("#<%= txtPeriodeAkhir.ClientID %>").attr('disabled', 'disabled');
                $("#<%= txtTahun.ClientID %>").removeAttr('disabled');
                $("#<%= txtPeriodeAwal.ClientID %>").val('');
                $("#<%= txtPeriodeAkhir.ClientID %>").val('');
            });

            $("#<%= rbPeriode3.ClientID %>").click(function () {
                $("#<%= txtPeriodeAwal.ClientID %>").attr('disabled', 'disabled');
                $("#<%= txtPeriodeAkhir.ClientID %>").attr('disabled', 'disabled');
                $("#<%= txtTahun.ClientID %>").attr('disabled', 'disabled');
                $("#<%= txtPeriodeAwal.ClientID %>").val('');
                $("#<%= txtPeriodeAkhir.ClientID %>").val('');
            });


            //radio button tipe transaksi
            $("#<%= rbJenisAksiKorporasi1.ClientID %>").click(function () {
                $("#<%= ddlJenisAksiKorporasi.ClientID %>").removeAttr('disabled');
            });

            $("#<%= rbJenisAksiKorporasi2.ClientID %>").click(function () {
                $("#<%= ddlJenisAksiKorporasi.ClientID %>").attr('disabled', 'disabled');
                $("#<%= ddlJenisAksiKorporasi.ClientID %>").val('-- pilih jenis aksi korporasi --');
            });

            //radio button sektor
            $("#<%= rbSektor1.ClientID %>").click(function () {
                $("#<%= ddlSektor.ClientID %>").removeAttr('disabled');
            });

            $("#<%= rbSektor2.ClientID %>").click(function () {
                $("#<%= ddlSektor.ClientID %>").attr('disabled', 'disabled');
                $("#<%= ddlSektor.ClientID %>").val('-- pilih sektor --');
            });

            //radio button sub sektor
            $("#<%= rbSubSektor1.ClientID %>").click(function () {
                $("#<%= ddlSubSektor.ClientID %>").removeAttr('disabled');
            });

            $("#<%= rbSubSektor2.ClientID %>").click(function () {
                $("#<%= ddlSubSektor.ClientID %>").attr('disabled', 'disabled');
                $("#<%= ddlSubSektor.ClientID %>").val('-- pilih sub sektor --');
            });

            //radio button sub sub sektor
            $("#<%= rbSubSubSektor1.ClientID %>").click(function () {
                $("#<%= ddlSubSubSektor.ClientID %>").removeAttr('disabled');
            });

            $("#<%= rbSubSubSektor2.ClientID %>").click(function () {
                $("#<%= ddlSubSubSektor.ClientID %>").attr('disabled', 'disabled');
                $("#<%= ddlSubSubSektor.ClientID %>").val('-- pilih sub sub sektor --');
            });

         });
    </script>
    <table border="0">
                <tr>
                    <td style="width: 50; height: 35px;">
                        Periode
                    </td>
                    <td style="height: 35px">
                        :
                    </td>
                    <td style="height: 35px">
                        <asp:RadioButton ID="rbPeriode1" runat="server" GroupName="rbPeriode" /><asp:TextBox ID="txtPeriodeAwal" runat="server" Width="150"></asp:TextBox> s/d
                        <asp:TextBox ID="txtPeriodeAkhir" runat="server" Width="150"></asp:TextBox>
                    </td>
               </tr>
               <tr>
                <td colspan="2"></td>
                        <td><asp:RadioButton ID="rbPeriode2" runat="server" GroupName="rbPeriode" text="Tahun"/>
                        <asp:TextBox ID="txtTahun" runat="server"  input type="text" maxlength="4" > </asp:TextBox></td>
               </tr>
               <tr>
                <td colspan="2"></td>
                        <td><asp:RadioButton ID="rbPeriode3" runat="server" GroupName="rbPeriode" 
                            Checked="True" Text="Semua" /></td>
                </tr>
                <tr>
                    <td style="width: 50">
                        Jenis Aksi Korporasi
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:RadioButton ID="rbJenisAksiKorporasi1" runat="server" GroupName="rbJenisAksiKorporasi"/>
                        <asp:DropDownList ID="ddlJenisAksiKorporasi" runat="server" Width="200">
                        </asp:DropDownList>
                    </td>
               </tr>
               <tr>
                <td colspan="2"></td>
                    <td>
                        <asp:RadioButton ID="rbJenisAksiKorporasi2" runat="server" GroupName="rbJenisAksiKorporasi" 
                            Checked="True" Text="Semua" />
                    </td>
                </tr>
                <tr>
                    <td style="width: 50">
                        Sektor
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:RadioButton ID="rbSektor1" runat="server" GroupName="rbSektor"/>
                        <asp:DropDownList ID="ddlSektor" runat="server" Width="450">
                        </asp:DropDownList>
                    </td>
                    <td rowspan="2">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="width: 50">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        <asp:RadioButton ID="rbSektor2" runat="server" GroupName="rbSektor" 
                            Checked="True" Text="Semua" />
                    </td>
                </tr>
                <tr>
                    <td style="width: 50">
                        Sub Sektor
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:RadioButton ID="rbSubSektor1" runat="server" GroupName="rbSubSektor"/>
                        <asp:DropDownList ID="ddlSubSektor" runat="server" Width="450">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td colspan="2"></td>
                    <td>
                        <asp:RadioButton ID="rbSubSektor2" runat="server" GroupName="rbSubSektor" 
                            Checked="True" Text="Semua" />
                    </td>
                </tr>
                <tr>
                    <td style="width: 50">
                        Sub Sub Sektor
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:RadioButton ID="rbSubSubSektor1" runat="server" GroupName="rbSubSubSektor"/>
                        <asp:DropDownList ID="ddlSubSubSektor" runat="server" Width="450">
                        </asp:DropDownList>
                    </td>
               </tr>
               <tr>
                <td colspan="2"></td>
                <td>
                        <asp:RadioButton ID="rbSubSubSektor2" runat="server" GroupName="rbSubSubSektor" 
                            Checked="True" Text="Semua" />
                    </td>
                </tr>
                <tr>
            <td colspan="2">
            </td>
            <td>
                <div style="text-align: right; padding-top: 10px;">
                    <button class="dialog_link ui-state-default ui-corner-all" id="btnNext" type="button">Lanjut</button>
                    <button class="dialog_link ui-state-default ui-corner-all" id="btnCancel" type="button">Batal</button>
                </div>
            </td>
        </tr>
      </table>
</asp:Content>